<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //1.替换字符 replace('被替换的字符','替换为的字符');
        //只会替换第一个字符
        var str='andy';
        console.log(str.replace('a','b'));
        //有一个字符串"ssssdwddefessd" 把所有的s替换为o
        var str1="ssssdwddefessd";
        while(str1.indexOf('s')!==-1){
            str1=str1.replace('s','*');
        }
        console.log(str1);
        //2.字符转换为数组split('分隔符'); 
        //前面我们学过 join 将数组转换为字符串
        var str2='red,pink,blue';
        console.log(str2.split(','));

        //3.toUpperCase() 转换为大写
        //3.toLowerCase() 转换为小写
    </script>
</head>
<body>
    
</body>
</html>